import request from "@/api/index";
interface dataSourceType {
  [propName: string]: any;
}
export const checkNameForm = async (_rule: dataSourceType = {}, value: any, callback: any = () => { }) => {
  await function () { }()// 防止有些数据结构，比如数组的长度变化时，vue监听不到，所以添加一个空的await阻止一下下面的promise
  if (_rule.required) {
    if (value === '' || value === undefined || (_rule.type == 'Array' && !value.length)) {
      
      return Promise.reject(`${_rule.msg1}`);
    } else {
      return Promise.resolve()
    }
  } else {
    return Promise.resolve()
  }
};

export const checkCount = () => {
  return Promise.resolve()
}
